package com.usefullc.extinguisher.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.usefullc.extinguisher.domain.FireDeviceAuditRecord;
import com.usefullc.extinguisher.query.FireDeviceAuditRecordQuery;
import com.usefullc.extinguisher.vo.FireDeviceAuditRecordVo;
import com.usefullc.extinguisher.vo.FireDeviceAuditStatVo;
import com.usefullc.system.entity.Pager;
import com.usefullc.system.query.BaseQuery;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

public interface FireDeviceAuditRecordMapper extends BaseMapper<FireDeviceAuditRecord> {

//useful_auto_generate_section_start


//useful_auto_generate_section_end

    IPage<FireDeviceAuditRecordVo> selectByPage(Page<FireDeviceAuditRecordVo> page, @Param(Constants.WRAPPER) Wrapper<FireDeviceAuditRecordQuery> queryWrapper);

    Long selectByPageCount(@Param(Constants.WRAPPER) Wrapper<FireDeviceAuditRecordQuery> queryWrapper);

    Integer findStatNumByBatchNo(@Param("jobId") Long jobId, @Param("batchNo") Long batchNo, Integer status);

    Integer findStatNumByRangeDateTime(@Param("jobId") Long jobId, @Param("startDateTime") LocalDateTime startDateTime, @Param("endDateTime") LocalDateTime endDateTime,Integer status);

    List<Long> findBatchNoByGroup(@Param("jobId") Long jobId);

    List<Long> findByGroup(@Param("query") BaseQuery query, @Param("pager") Pager pager);

    Long findByGroupCount(@Param("query") BaseQuery query);

    Integer findTotalStatNumByRangeDateTime(@Param("status") Integer status,@Param("startDateTime") Date startDateTime, @Param("endDateTime") Date endDateTime);

    Integer findTotalPersonNumByRangeDateTime(@Param("startDateTime") Date startDateTime, @Param("endDateTime") Date endDateTime);
}
